import { get, post } from '@/utils/request'
const BASE_URL = window.baseUrl.icp

// 关联数据源-分页查询数据源
export function getReferenceSourceList(query) {
  return post(BASE_URL + '/relation/datasource/list', query)
}

// 关联数据源-查询不分页列表
export function datasourceList() {
  return get(BASE_URL + '/relation/datasource/datasourceList')
}

// 关联数据源-查询内部资源详情
export function datasourceDetail(query) {
  return get(BASE_URL + '/relation/datasource/datasourceDetail/' + query)
}

// 关联数据源-新增
export function addData(query) {
  return post(BASE_URL + '/relation/datasource/add', query)
}

// 关联数据源-删除
export function delDatasource(query) {
  return get(BASE_URL + '/relation/datasource/remove/' + query)
}

// 关联数据源-校验修改数据
export function checkEdit(query) {
  return post(BASE_URL + '/relation/datasource/checkEdit', query)
}

// 关联数据源-校验连接校验后允许提交- 测试
export function submitData(query) {
  return post(BASE_URL + '/relation/datasource/testLink', query)
}

// 关联数据源-修改
export function editDataSource(query) {
  return post(BASE_URL + '/relation/datasource/edit', query)
}

// 关联数据-分页查询数据
export function getReferenceDataPage(query) {
  return post(BASE_URL + '/relation/data/list', query)
}
// 关联数据-查询统计
export function getCountData(query) {
  return post(BASE_URL + '/relation/data/count', query)
}

// 关联数据-执行获取测试sql数据
export function getRefSqlData(query) {
  return post(BASE_URL + '/relation/data/getRefSqlData', query)
}

//关联数据-修改
export function externalData(query) {
  return post(BASE_URL + '/relation/data/edit/externalData', query)
}

// 关联数据-新增外部资源
export function externalRef(query) {
  return post(BASE_URL + '/relation/data/add/externalRef', query)
}

// 关联数据-新增内部资源
export function constantRef(query) {
  return post(BASE_URL + '/relation/data/add/constantRef', query)
}

// 关联数据-分页查询内部资源
export function getRefConstantList(query) {
  return post(BASE_URL + '/relation/data/getRefConstantList', query)
}

// 关联数据-查询外部资源详情
export function getRefExternalDetail(query) {
  return get(BASE_URL + '/relation/data/getRefExternalDetail/' + query)
}

// 关联数据-查询内部资源详情
export function getRefConstantDetail(query) {
  return post(BASE_URL + '/relation/data/getRefConstantDetail', query)
}

// 关联数据-删除
export function delData(query) {
  return get(BASE_URL + '/relation/data/delRefDataById/' + query)
}

// 关联数据-弹窗列表删除
export function delRefDataById(query) {
  return post(BASE_URL + '/relation/data/deleteConstantData', query)
}
